﻿using Core.Caching;

namespace Core.Identity.Menus.Caching;

public static class MenusCacheKey
{
    public const string GetAllCacheKey = "all-menus";

    public const string GetRoleMenusCacheKey = "role-menus";

    public static string GetMeMenusCacheKey(string parameters)
    {
        return $"MenusCacheKey:GetMeMenusQuery,{parameters}";
    }

    public static string GetPaginationCacheKey(string parameters)
    {
        return $"MenusCacheKey:UsersWithPaginationQuery,{parameters}";
    }

    public static IEnumerable<string>? Tags => new string[] { "menu" };

    public static void Refresh()
    {
        CacheFactory.RemoveByTags(Tags);
    }
}
